package com.markus.code.Thread.pool;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Author:markusZhang
 * Date:Create in 2020/8/17 11:37
 * todo:
 */
public class MyThreadPool {
    public ThreadPoolExecutor threadPoolExecutor(){
        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(5,
                10,
                10,
                TimeUnit.SECONDS,
                new LinkedBlockingDeque<>(10000),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());
        return poolExecutor;
    }
}
